sizerequest: Don't pass uninitialized values to measure
authorTimm Bäder <mail@baedert.org>
Sat, 28 Oct 2017 09:37:13 +0000 (11:37 +0200)
committerTimm Bäder <mail@baedert.org>
Sat, 28 Oct 2017 09:42:08 +0000 (11:42 +0200)
The GtkWidgetClass::measure vfunc is not required to assign a value to
any of the (out) parameters, so we need to initialize the locals we pass
to it, otherwise we can end up with a garbage size request.

gtk/gtksizerequest.c

index 9d991b10d181e9ce1a3f5cd32d1a98b88b0d2bcd..458a6d1aa852619f5227717d0e864616ea0d8a7a 100644 (file)
@@ -189,8 +189,8 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
       else
         {
           int dummy = 0;
-          int minimum_for_size;
-          int natural_for_size;
+          int minimum_for_size = 0;
+          int natural_for_size = 0;
 
           /* Pull the base natural size from the cache as it's needed to adjust
            * the proposed 'for_size' */